<template>
  <div>
    <el-form-item label="广告位编码：">
      <input v-model="tempValue.adCode"
             placeholder="请输入广告编码" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary"
                 @click="emitadCode">确定</el-button>
    </el-form-item>
  </div>
</template>
<script>
import { mapState, mapGetters } from 'vuex';
import changeImage from '../../components/changeImage';

export default {
  name: "qkAdvertAttr",
  props: {
    prop: {
      type: Object,
      default () {
        return {
          adCode: 'XT_AP1202837735474900993'
        }
      }
    }
  },
  components: {
    changeImage
  },
  data () {
    return {
      tempValue: {}
    }
  },
  methods: {
    emitadCode () {
      this.$store.commit("updateActiveElementProp", { adCode: this.tempValue.adCode });
    }
  },
  mounted () {
    this.tempValue = this.prop;
  },
  watch: {
    // 'tempValue.adCode'(e) {
    //   this.$store.commit("updateActiveElementProp",{adCode:e});
    // },
    // deep:true
  }
}
</script>

<style lang="scss" scoped>
.arrt-eidt-wrapper {
  display: flex;
  .arrt-eidt-l {
    width: 108px;
  }
  .arrt-eidt-r {
    flex: 1;
  }
}
</style>


